<?php

namespace common\models\base;

use Yii;

/**
 * This is the model class for table "{{%multi_media_upload_quene}}".
 *
 * @property int $id
 * @property int $custom_id
 * @property string $file_urls
 * @property string $dirname
 * @property int $status
 * @property int $created_at
 * @property string $idno
 *
 * @property Custom $custom
 */
class MultiMediaUploadQuene extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%multi_media_upload_quene}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['custom_id', 'file_urls', 'dirname', 'created_at'], 'required'],
            [['custom_id', 'status', 'created_at'], 'integer'],
            [['file_urls'], 'string'],
            [['dirname', 'idno'], 'string', 'max' => 50],
            [['custom_id'], 'exist', 'skipOnError' => true, 'targetClass' => Custom::className(), 'targetAttribute' => ['custom_id' => 'id']],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'custom_id' => Yii::t('app', 'Custom ID'),
            'file_urls' => Yii::t('app', 'File Urls'),
            'dirname' => Yii::t('app', 'Dirname'),
            'status' => Yii::t('app', 'Status'),
            'created_at' => Yii::t('app', 'Created At'),
            'idno' => Yii::t('app', 'Idno'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getCustom()
    {
        return $this->hasOne(Custom::className(), ['id' => 'custom_id']);
    }
}
